/* Add common types to the namespace memchart */

#ifndef MC_TYPES_HPP
#define MC_TYPES_HPP

#include <cstddef>
#include <iomanip>
#include <string>
#include <sstream>
#include <utility>
#include <vector>

#ifdef _MSC_VER
	/* Workaround to get uintptr_t */
	#define _HAS_TR1_DECLARATIONS 1
#endif

/* TR1 headers */
#ifdef __GLIBCXX__
	#include <tr1/cstdint>
	#include <tr1/memory>
#else
	#include <cstdint>
	#include <memory>
#endif

namespace memchart
{
	using std::size_t;
	using std::tr1::uintptr_t;

	using std::string;
	using std::vector;

	using std::tr1::shared_ptr;

	using std::pair;
	using std::make_pair;

	inline string to_string (uintptr_t val)
	{
		std::ostringstream os;

		if (os << "0x" << std::hex << val)
			return os.str();
		else
			return "?";
	}
}

#endif /* MC_TYPES_HPP */
